package com.opi.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {

	/**
	 @param type
		1 = "yyyy-MM-dd HH:mm:ss";
		2 = "yyyy-MM-dd HH:mm";
		3 = "yyyy/MM/dd HH:mm";
		4 = "yyyy-MM-dd";
		5 = "yyyy/MM/dd";
	 * 
	 * @return
	 */
	public static String getNowTime(int type){
		Date nowTime=new Date(); 
		SimpleDateFormat time = null;
		if(type==1){
			time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
		}else if(type==2){
			time = new SimpleDateFormat( "yyyy-MM-dd HH:mm"); 
		}else if(type==3){
			time = new SimpleDateFormat("yyyy/MM/dd HH:mm"); 
		}else if(type==4){
			time = new SimpleDateFormat("yyyy-MM-dd"); 
		}else if(type==5){
			time = new SimpleDateFormat("yyyy/MM/dd"); 
		}else{
			return "";
		}
		return time.format(nowTime); 
	}
	
	
}
